/******************************************************************************
 *
 * @file       textbubble.h
 * @brief      文本气泡
 *
 * @author     ario
 * @date       2024/08/09
 * @history
 *****************************************************************************/

#ifndef TEXTBUBBLE_H
#define TEXTBUBBLE_H



#include "bubbleframe.h"
#include <QTextEdit>
#include <QHBoxLayout>

class TextBubble : public BubbleFrame
{
    Q_OBJECT
public:
    TextBubble(ChatRole role, const QString &text, QWidget *parent = nullptr);
protected:
    bool eventFilter(QObject *o, QEvent *e);
private:
    void adjustTextHeight();
    void setPlainText(const QString &text);
    void initStyleSheet();
private:
    QTextEdit *m_pTextEdit;
};

#endif // TEXTBUBBLE_H
